Is erasing the `misc` partition a solution to automatic/unnecessary boot into TWRP after having installed LineageOS 15?


Question

I'm sure this question has been asked before, but I'm unable to find a good answer that I can understand, so bear with me:



I've recently installed TWRP & LineageOS 15 on my Moto G5 (cedric), although I'm sure I messed the process up a bit, because I had almost-bricked my phone in the meantime and don't really understand how I solved it either. Now everything is working again, except for the fact that when I (re)start my phone, it automatically boots into TWRP instead of LineageOS. The way I boot into LineageOS anyway, is to tell TWRP to reboot into the bootloader (or go to the bootloader directly with the volume key trick), and then from the bootloader I use 'start'.



A possible solution that I've found on the internet involved changing / erasing the misc partition, as it would be responsible for directing a boot to either TWRP or LineageOS. However, other google results tell me that erasing misc could gravely upset your phone.



The main question is: Is it correct that zero-ing the misc partition is a solution to this boot issue, as the possible solution states? Or is it misleading and the boot issue is probably something else entirely?



Here's the hexdump of the current contents of my misc partition (the result of first copying it to my computer with dd if=/dev/block/bootdevice/by-name/misc of=/storage/FE84-1705/misc.img and adb pull ..., and then running hexdump -C misc.img):



hexdump -C misc.img 
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000800 62 6f 6f 74 2d 72 65 63 6f 76 65 72 79 00 00 00 |boot-recovery...|
00000810 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000840 72 65 63 6f 76 65 72 79 0a 2d 2d 77 69 70 65 5f |recovery.--wipe_|
00000850 64 61 74 61 0a 2d 2d 72 65 61 73 6f 6e 3d 77 69 |data.--reason=wi|
00000860 70 65 5f 64 61 74 61 5f 76 69 61 5f 72 65 63 6f |pe_data_via_reco|
00000870 76 65 72 79 0a 00 00 00 00 00 00 00 00 00 00 00 |very............|
00000880 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00001500 71 65 20 30 2f 30 00 00 00 00 00 00 00 00 00 00 |qe 0/0..........|
00001510 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00001520 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |1...............|
00001530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00100000


And this is the result of running fdisk -l misc.img:



Disk misc.img: 1 MiB, 1048576 bytes, 2048 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Furthermore, I've installed TWRP 3.2.1-0-cedric and LineageOS 15.0-20171125_073252-UNOFFICIAL-cedric.


Answer

I went ahead and changed it anyway, and the answer is YES.



The qe 0/0 part has something to do with Motorola's way of assessing whether the phone is and/or has been rooted, and the last 1 I don't understand. I went ahead and used hexedit to remove only the boot-recovery and recovery.--wipe_data.--reason=wipe_data_via_recovery parts, then transferred and wrote the new image back to the misc partition; and now the phone starts up to LineageOS automatically.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes